<?php
	header("Content-type: text/html; charset=utf-8");
	define('ALLOWGUEST',true);
	session_start();
	require_once './source/core/run.php';
	require_once 'data/include/Functions.php';
	require_once 'data/include/Cart.class.php';
	$sid = $_POST['sid'];
	$decreaseNum = $_SESSION['cart']['goods'][$sid]['num'];
	$oraginalNum = $_SESSION['cart']['total_rows'];
	$_SESSION['cart']['total_rows'] = $oraginalNum-$decreaseNum;
	$_SESSION['cart']['goods'][$sid]['num'] = 0 ;
	$decreasePrice = $_SESSION['cart']['goods'][$sid]['total'];
	$oraginalPrice = $_SESSION['cart']['total'];
	$_SESSION['cart']['total'] = $oraginalPrice-$decreasePrice;
	$_SESSION['cart']['total'];
	if($sid){
		unset($_SESSION['cart']['goods'][$sid]);
		echo json_encode($_SESSION['cart']);
		die;
	}
	
	
?>